<template>
  <div class="body">
 <el-tabs style="height: 100%;"  class="3asaasd" type="card" v-model="activeName" >
            <el-tab-pane label="待支付" name="first">    <cioands></cioands></el-tab-pane>
            <el-tab-pane label="已支付" name="second">   <scioands></scioands></el-tab-pane>
          </el-tabs>
  </div>
</template>

<script>
import { payment, paydel } from "@/api/payment";
import cioands from "@/views/finance/baohan/zhifu.vue";
import scioands from "@/views/finance/baohan/zhifus.vue";
export default {
    components: {
    cioands,
    scioands,
 
  },
  data() {
    return {
      paymentlist: [],
         activeName:"first",
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 表单参数
      form: {
        name: ""
      },
      // 表单校验
      rules: {},
      params: {
        limit: 10,
        offset: 0,
        keywords: ""
      },
      total: null,
      multipleSelection: []
    };
  },

  created() {
    this.payments();
  },
  methods: {
    //页面
    shuaxin(){
this.payments();
    },
    payments() {
      // this.params.user_id = sessionStorage.getItem("user_id");
      payment(this.params).then(response => {
        this.paymentlist = response.data.data.rows;
        this.total = response.data.data.total;
      });
    },
    // del() {
    //   let arr = [];
    //   this.multipleSelection.forEach(item => {
    //     arr.push(item.proid);
    //   });
    //   arr = arr.toString();
    //   let user_id = sessionStorage.getItem("user_id");
    //   delgongcheng({ user_id, ids: arr }).then(res => {
    //     if (res.data.code == 1) {
    //       this.$message.success("删除成功");
    //       this.bids();
    //     } else {
    //       this.$message.error("网络异常,稍后再试");
    //     }
    //   });
    // },
    // 表单重置
    reset() {
      this.form = {
        name: ""
      };
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    //新增按钮操作
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加档案架";
    },
    //修改
    handleUpdate() {
      this.reset();
      this.open = true;
      this.title = "修改档案架";
    },
    del() {
      let arr = [];
      this.multipleSelection.forEach(item => {
        arr.push(item.id);
      });
      arr = arr.toString();
      console.log(arr);
      let user_id = "//sessionStorage.getItem()";
      paydel({ user_id, ids: arr }).then(res => {
        if (res.data.code == 1) {
          this.$message.success("删除成功");
          this.payments();
        } else {
          this.$message.error("网络异常,稍后再试");
        }
      });
    },
    //提交按钮
    onSubmit() {
      alert("submit!");
      this.open = false;
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    handleSizeChange(val) {
      this.params.limit = val;
      this.payments();
    },
    handleCurrentChange(val) {
      this.params.offset = parseInt(val - 1) * this.params.limit;
      this.payments();
    }
  }
};
</script>

<style scoped>
.body {
  /* width: 86vw;
  height: 91vh; */
}

.table {
  width: 100%;
  margin-top: 2vh;
}

.block {
  position: fixed;
  bottom: 20px;
  right: 20px;
}
</style>
